package com.itcs.app.properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;

/**
 * @author LiuPeng
 * @date 2017年12月22日
 * 
 */
@Component
public class PropertiesService implements InitializingBean {

	private Log logger = LogFactory.getLog(getClass());

	@Autowired
	private ZsConfig zsConfig;

	@Autowired
	private BsConfig bsConfig;

	private static ZsConfig staticZsConfig;

	private static BsConfig staticBsConfig;

	public static ZsConfig getZsConfig() {
		return staticZsConfig;
	}

	public static BsConfig getBsConfig() {
		return staticBsConfig;
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		staticZsConfig = zsConfig;
		staticBsConfig = bsConfig;
		logger.info("加载现在支付配置文件zsConfig:"+JSON.toJSONString(zsConfig));
		logger.info("加载现在支付配置文件bsConfig:"+JSON.toJSONString(bsConfig));
	}
}
